import request from '@/utils/request'

export function fetchExpenditureList(query) {
  return request({
    url: '/expenditure/use/list',
    method: 'get',
    params: query
  })
}
export function fetchExpDisList(query) {
  return request({
    url: '/expenditure/dis/list',
    method: 'get',
    params: query
  })
}
export function fetchExpenditureDetail(id) {
  return request({
    url: '/expenditure/use/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchTotalDistributionChartData() {
  return request({
    url: '/expenditure/distribution/total/chart',
    method: 'get'
  })
}
export function fetchOrgTotalUseChartData(oid) {
  return request({
    url: '/expenditure/use/org/total/chart',
    method: 'get',
    params: { oid }
  })
}

export function addExpUse(data) {
  return request({
    url: '/expenditure/use/add',
    method: 'post',
    data
  })
}
export function addExpDis(data) {
  return request({
    url: '/expenditure/dis/add',
    method: 'post',
    data
  })
}

export function updateExpUse(data) {
  return request({
    url: '/expenditure/use/update',
    method: 'post',
    data
  })
}

